package com.sunzm.flink.utils

import com.sunzm.flink.datastream.scala.SocketSourceScala.isLocal
import org.apache.flink.streaming.api.scala.StreamExecutionEnvironment

/**
 * ${DESCROPTION}
 *
 * @author sunzm
 * @date 2022-01-18
 * @version 1.0
 */
object FlinkEnvUtils {

  def getStreamExecutionEnvironment(isLocalMode: Boolean) = {
    val env: StreamExecutionEnvironment = if (isLocalMode) {
      StreamExecutionEnvironment.createLocalEnvironmentWithWebUI()
    } else {
      StreamExecutionEnvironment.getExecutionEnvironment
    }

    env
  }
}
